#include "RadianResourceLoadListener.h"
#include "OgreResource.h"
#include "core/logManager.h"
#include "RadianAir.h"
#include "RadianEditor.h"
//--------------------------------------------------------------------------
extern RadianAir* G_RadianAir;
//--------------------------------------------------------------------------
RadianResourceLoadingListener::RadianResourceLoadingListener()
	:m_LoadingCout(0)
	,m_LoadingResName(Ogre::StringUtil::BLANK)
{

}
//--------------------------------------------------------------------------
RadianResourceLoadingListener::~RadianResourceLoadingListener()
{

}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::resourceGroupScriptingStarted(const Ogre::String& groupName, size_t scriptCount)
{
	G_RadianAir->show();
	G_RadianAir->SetFullResourceCount(scriptCount);
}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::scriptParseStarted(const Ogre::String& scriptName, bool& skipThisScript)
{
	skipThisScript = false;
	G_RadianAir->SetLoadingInfo(scriptName);
	Ogre::LogManager::getSingletonPtr()->logMessage("  Parsing: " + scriptName);
}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::scriptParseEnded(const Ogre::String& scriptName, bool skipped)
{
	G_RadianAir->AddLoadingCount();
}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::resourceGroupScriptingEnded(const Ogre::String& groupName)
{
	// notify engine visible here.
	G_RadianAir->setVisible(false);
	RadianEditor::getSingletonPtr()->ShowEditor();
	
}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::resourceGroupLoadStarted(const Ogre::String& groupName, size_t resourceCount)
{
	
}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::resourceGroupPrepareEnded(const Ogre::String& groupName)
{

}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::resourceLoadStarted(const Ogre::ResourcePtr& resource)
{

}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::resourceLoadEnded(void)
{

}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::resourceGroupLoadEnded(const Ogre::String& groupName)
{

}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::worldGeometryStageStarted(const Ogre::String& description)
{
	// do nothing.
}
//--------------------------------------------------------------------------
void RadianResourceLoadingListener::worldGeometryStageEnded(void)
{
	// do nothing.
}//--------------------------------------------------------------------------